﻿using System;
using System.Runtime.InteropServices;

namespace Vtron.HipcConfigurationTools.Domain
{
    /// <summary>
    /// IIC设备寄存器配置的请求
    /// </summary>
    /// <remarks>
    /// typedef  struct
    /// {
    ///     T_HIPC_NET_HEADER	   head;      //协议头
    ///     Uint8    iicId;     //iic的ID 0或者1
    ///     Uint8    slaveAddress; // 从设备地址
    ///     Uint16  offsetAddress;  //p偏移地址
    ///     Uint16   value;
    /// } T_HIPC_DEBUG_IIC_REQ;
    /// </remarks>
    [Serializable]
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    public struct T_HIPC_DEBUG_IIC_REQ
    {
        #region Fields

        /// <summary>
        /// 网络协议数据头
        /// </summary>
        public T_HIPC_NET_HEADER head;

        /// <summary>
        /// iic的ID
        /// </summary>
        /// <remarks>
        /// 0或者1
        /// </remarks>
        public byte iicId;

        /// <summary>
        /// 从设备地址
        /// </summary>
        public byte slaveAddress;

        /// <summary>
        /// p偏移地址
        /// </summary>
        public Int16 offsetAddress;

        /// <summary>
        /// value
        /// </summary>
        public Int16 value;

        #endregion
    }
}
